#!/usr/bin/perl

use Data::Dumper;

#What name do you wish? ZidaneT
#Password: 

#/ >
#hp: 440/440  mp: 820/820  sp: 440/440 >


use Net::Telnet;

my @output;

my $netobj = new Net::Telnet (	
								Host       => "localhost",
								Port       => 6666,
								Prompt     => '/\/.* >/',
								Timeout    => 5
								);

#try to open

if ( $netobj->open() )
{
	print "Port Opened OK\n";
}
else
{
	die();
}


@output = $netobj->waitfor('/What name do you wish\?/');

print "Saw login request ok\n";

print Dumper(@output);

print "logging in\n";
$netobj->print("Architect");

print "waiting for password\n";
$netobj->waitfor('/Password: /');

print "entering password\n";
$netobj->print("12345");

$netobj->waitfor('/\/realms\/architect >/');

print "Looking around\n";
@output = $netobj->cmd("l");
print Dumper(@output);

print "quitting\n";
$netobj->cmd("quit");





print "done";